function initI18n(lang) {
  var allConfig = {
    'zh-cn': {
      common: {
        warehouseMaterial: {
          warehouseType: {
            "1": "成品仓",
            "2": "报废品仓",
            "3": "待处理仓",
            "4": "原/辅料仓",
            "6": "半成品仓"
          }
        },
        warehouseSourceType: {
          "1": "订单采购入库",
          "2": "订单出库到车间",
          "3": "库存采购入库",
          "4": "无采购单入库",
          "5": "库存出库",
          "6": "订单出库到外协",
          "7": "车间交入",
          "8": "模板导入",
          "9": "出库给客户",
          "10": "库存盘点",
          "11": "物料转仓"
        },
        isTax: {
          "0": "无",
          "1": "不含税",
          "2": "含税"
        }
      },
      login: {
        error: {
          company: '请输入公司名称',
          userName: '请输入用户名/手机号',
          password: '请输入密码',
          verificationCode: '请输入验证码',
          oldPassword: '请输入当前密码',
          newPassword: '请输入新密码',
          confirmPassword: '请输入确认密码'
        }
      },
      customer: {
        paymentWayType: {
          "0": "现金结",
          "1": "一个月结",
          "2": "二个月结",
          "3": "三个月结",
          "4": "四个月结",
          "5": "五个月结",
          "6": "六个月结",
          "7": "七个月结",
          "8": "八个月结",
          "9": "九个月结",
          "10": "十个月结",
          "11": "十一个月结",
          "12": "一年结",
          "18": "一年半结",
          "24": "二年结"
        },
        customerType: {
          "1": "供应商",
          "2": "客户",
          "3": "供应商+客户"
        },
        tax: {
          "0": "含税",
          "1": "不含税"
        },
        freight: {
          "0": "我司",
          "1": "供方"
        },
        error: {
          agent: {
            customerCode: "请输入代理商代码",
            customerName: "请输入代理商名称",
            contact: "请输入联系人",
            paymentWay: "请选择付款结算方式",
            status: "请选择状态",
            parentSupplier: "请选择供应商"
          }
        }
      },
      equipmentInfo: {
        error: {
          equipmentNo: "请输入设备编号",
          equipmentName: "请输入设备名称",
          equipmentImage: "请上传设备图片",
          notUniqueNo: "该设备编号已经存在",
          startProportion: "请输入产能比例",
          endProportion: "请输入产能比例"
        }
      },
      orderCirculation: {
        createOutOrder: {
          orderId: "请选择订单编号",
          supplier: "请选择供应商",
          technology: "请选择加工工艺",
          flowCycle: "请输入流程周期",
          maching: "请选择加工对象",
          valuationUint: "请输入计价单位",
          "material-count": "请输入对应加工对象颜色数量",
          "material-valuationCount": "请输入对应加工对象颜色计价数量",
          "material-unitPrice": "请输入对应加工对象颜色单价",
          "material-unitPriceZero": "加工对象颜色单价不能为0",
          "material-colorList": "请选择加工对象颜色",
          "ele-count": "请输入对应电镀颜色数量",
          "ele-valuationCount": "请输入对应电镀颜色计价数量",
          "ele-unitPrice": "请输入对应电镀颜色单价",
          "ele-unitPriceZero": "电镀颜色单价不能为0",
          "ele-colorList": "请选择需要电镀的物料颜色"
        },
        outHandover: {
          orderId: "请选择订单编号",
          workShop: "请选择交接车间",
          materialType: "请选择交接物料类型",
          "material-count": "请输入交接物料合格数",
          "material-noCount": "请输入交接物料不合格数",
          "material-countZero": "交接物料的合格数和不合格数不能同时为0",
          "material-colorList": "请选择交接物料类型颜色",
          "ele-count": "请输入交接电镀物料合格数",
          "ele-noCount": "请输入交接电镀物料不合格数",
          "ele-countZero": "交接电镀物料的合格数和不合格数不能同时为0",
          "ele-colorList": "请选择需要交接电镀物料的颜色"
        }
      },
      querryOrder: {
        orderMatchStatus: {
          "1": {
            text: "已完成",
            color: "#000000",
            label: "已完成"
          },
          "2": {
            text: "不配套",
            color: "#ff0000",
            label: "未到齐物料"
          },
          "3": {
            text: "不配套",
            color: "#ffa500",
            label: "已到齐，并行车间未到齐"
          },
          "4": {
            text: "配套",
            color: "#00ff00",
            label: "已配套"
          }
        },
        putOutStatus: {
          "0": "无外协",
          "1": "完成",
          "2": "未完成"
        }
      },
      templateSetting: {
        pageSize: {
          "A3": "A3(297*420)",
          "A4": "A4(210*297)",
          "A5": "A5(148*210)",
          "B3": "B3(353*500)",
          "B4": "B4(250*353)",
          "B5": "B5(176*250)",
          "default": "自定义"
        },
        sizeUnit: {
          "px": "像素(px)",
          "mm": "毫米(mm)",
          "cm": "厘米(cm)"
        },
        direction: {
          vertical: "纵向",
          horizontal: "横向"
        },
        type: {
          purchaseOrder: "采购单",
          prePurchaseOrder: "预采购单",
          warehouseInoutOrder: "出入库记录单",
          outOrder: "外协单",
          issueOrder: "发料单",
          returnOrder: "退货单"
        },
        tableName: {
          orderPurchaseColumns: "订单采购单",
          warehousePurchaseColumns: "库存采购单",
          prePurchaseColumns: "预采购单",
          warehouseInoutOrderColumns: "出库单",
          productWarehouseInoutOrderColumns: "成品仓出库单",
          outOrderColumns: "外协单",
          issueOrderColumns: "发料单"
        },
        columnName: {
          label: "列名",
          width: "宽度",
          field: "列显示内容"
        },
        proOrder: {
          type: {
            material_type: "物料类型",
            material_name: "物料名称",
            material_model: "规格",
            color: "编号",
            color_description: "颜色描述",
            provider_name: "供应商",
            quality_type: "材质",
            feed_total: "投料数",
            remark: "说明"
          },
          align: {
            left: "左对齐",
            center: "居中",
            right: "右对齐"
          }
        }
      },
      companyAuthoritySetting: {
        error: {
          payTime: "请选择支付时间",
          endTime: "请选择到期时间",
          clockTime: "请选择提醒时间",
          'payTime>endTime': "支付时间不能晚于到期时间",
          'clockTime>endTime': "提醒时间不能晚于到期时间"
        }
      },
      warehouse: {
        statusType: {
          "1": "采购单未审核",
          "2": "库存不足"
        },
        warehouseOrderType: {
          "1": "本订单",
          "2": "相似单"
        },
        warehouseOutOrderType: {
          "1": "本订单",
          "2": "其他订单出本订单库存",
          "3": "本订单出其他订单库存"
        },
        error: {
          customerName: "请选择出库客户",
          count: "请输入出库数量",
          outCountPrice: "请输入出库单价",
          inOutMoney: "请输入金额",
          inOutUnit: "请输入出库单位"
        }
      },
      warehouseInOutRecord: {
        status: {
          "0": "未审核",
          "1": "已审核",
          "2": "已退回"
        },
        timeType: {
          "create": "制单日期",
          "balance": "结算日期"
        },
        type: {
          "1": "入库",
          "2": "出库"
        },
        queryType: {
          "1": "我制的单",
          "2": "我确认的"
        },
        warehouseType: {
          "1": "成品仓",
          "2": "报废品仓",
          "3": "待处理仓",
          "4": "原材料仓",
          "5": "辅料仓",
          "6": "半成品仓"
        },
        error: {
          count: "请输入出入库数量",
          selfOutFuCount: "请输入交接数"
        }
      },
      createIssueNote: {
        dialogTitle: {
          outToOrder: "出库给订单",
          outOrder: "发料到外协"
        },
        error: {
          supplier: "请选择外协供应商",
          technology: "请选择加工工艺",
          flowCycle: "请输入流程周期",
          valuationUint: "请输入计价单位",
          valuationCount: "请输入计价数量",
          unitPrice: "请输入单价"
        }
      },
      energyMgr: {
        state: {
          "1": "使用",
          "2": "未使用"
        },
        isAgree: {
          "1": "启用",
          "2": "禁用"
        },
        energyType: {
          "1": "电表",
          "2": "水表",
          "3": "气表"
        },
        variableRatio: {
          "1": "1:1",
          "10": "50:5",
          "15": "75:5",
          "20": "100:5",
          "30": "150:5",
          "40": "200:5"
        },
        error: {
          "no": "请输入仪器编号",
          "name": "请输入仪器名称",
          "energyType": "请选择仪器类型",
          "variableRatio": "请输入变比",
          "workshopList": "请选择部门车间",
          "workshopRepeat": "设置的车间有重复"
        }
      },
      receiptPayment: {
        type: {
          "1": "收款",
          "2": "付款"
        },
        status: {
          "0": "未审核",
          "1": "已审核",
          "2": "已退回"
        },
        source: {
          "0": "仓库",
          "1": "外协",
          "3": "其他费用单"
        }
      },
      shoppingMallMaterial: {
        status: {
          "0": "下架",
          "1": "上架"
        },
        synchronizationType: {
          "1": "同步",
          "2": "不同步"
        },
        error: {
          materialForm: {
            materialName: "请输入物料名称",
            materialType: "请输入物料类型",
            model: "请输入规格型号",
            color: "请输入编号",
            colorDescription: "请输入描述",
            unit: "请输入单位",
            companyName: "请输入商家",
            defaultWarehouse: "请选择默认仓库",
            count: "请输入库存数量"
          },
          supplierForm: {
            code: "请输入供应商代码",
            name: "请输入供应商名称",
            contact: "请输入联系人",
            paymentWay: "请选择结算方式",
            emailInvalid: "请输入有效email邮箱地址",
            codeNonUnique: "供应商代码已存在",
            nameNonUnique: "供应商名称已存在"
          }
        }
      },
      financeMgr: {
        balance: {
          "0": "否",
          "1": "是"
        },
        type: {
          "1": "订单采购入库",
          "2": "库存采购入库",
          "3": "无采购入库"
        },
        materialStockMoney: {
          warehouseType: {
            "1": "成品仓",
            "2": "报废品仓",
            "3": "待处理仓",
            "4": "原/辅料仓",
            "6": "半成品仓"
          }
        },
        bankCardSetting: {
          status: {
            "1": "启用",
            "2": "禁用"
          }
        },
        advancePayment: {
          source: {
            "1": "合同定金",
            "2": "担保金",
            "3": "押金"
          },
          status: {
            "0": "未审核",
            "1": "已审核",
            "2": "已退回"
          },
          isUsed: {
            "0": "未使用",
            "1": "已使用"
          },
          inBalance: {
            type: "请选择收付款类型",
            sumMoney: "请输入预付款金额",
            receviePaymentUserName: "请选择预收款方",
            source: "请选择付款用途",
            sourceStr: "请输入付款用途描述",
            advanceNo: "请输入合同编号",
            paymentDay: "请选择预付款日期",
            relationBank: "请选择银行卡号"
          },
          outBalance: {
            type: "请选择收付款类型",
            sumMoney: "请输入预收款金额",
            receviePaymentUserName: "请选择预付款方",
            source: "请选择收款用途",
            sourceStr: "请输入收款用途描述",
            advanceNo: "请输入合同编号",
            paymentDay: "请选择预收款日期",
            relationBank: "请选择银行卡号"
          }
        }
      },
      purchaseOrder: {
        status: {
          "0": "未审核",
          "1": "已审核"
        },
        inCountStatus: {
          "0": "否",
          "1": "是"
        },
        printStatus: {
          "0": "否",
          "1": "是"
        },
        purchaseStatus: {
          "0": "否",
          "1": "是"
        },
        orderType: {
          "1": "订单采购",
          "2": "库存采购"
        },
        recoveryPhase: {
          "laterPhaseOne": "预计收货期",
          "laterPhaseTwo": "复期1",
          "laterPhaseThr": "复期2",
          "laterPhaseFour": "复期3"
        },
        hidePriceForPurchase: {
          "0": "显示",
          "1": "不显示"
        },
        error: {
          hidePriceForPurchase: {
            "0": "所选择物料都为显示金额，不能再修改为显示",
            "1": "所选择物料都为不显示金额，不能再修改为不显示"
          }
        }
      },
      feddingBill: {
        source: {
          "1": "公司",
          "2": "商城"
        },
        status: {
          "0": "未审核",
          "1": "已审核"
        },
        approvalStatus: {
          "0": "待审核",
          "1": "已审核",
          "2": "已退回"
        },
        error: {
          "feedTotal": "请输入投料数",
          "provider": "请选择供应商",
          "singleFeedCount": "请输入单付投料数",
          "actualFeedCount": "请输入实际投料数"
        }
      },
      attendance: {
        takeOffType: {
          "1": "年假",
          "2": "事假",
          "3": "病假",
          "4": "调休",
          "5": "产假",
          "6": "陪产假",
          "7": "婚假",
          "8": "例假",
          "9": "丧假",
          "10": "公出"
        },
        classesSetting: {
          error: {
            className: "请输入班次名称",
            classNameNoMatch: "班次名称是由中英文或数字组成",
            earlyTime: "最晚打卡时间不为空，最早打卡时间不能为空",
            lateTime: "最早打卡时间不为空，最晚打卡时间不能为空"
          }
        },
        approvalSetting: {
          type: {
            "1": "请假审批",
            "2": "补卡审批",
            "3": "加班审批",
            "4": "报销审批",
            "5": "行政处罚审批",
            "6": "行政奖励审批"
          },
          error: {
            type: "请选择审批类型",
            ids: "请勾选可审核人",
            deptId: "请选择部门",
            users: "请设置审核流程"
          }
        },
        device: {
          type: {
            "1": "指纹打卡一代",
            "2": "体温打卡一代",
            "3": "人脸打卡一代"
          },
          error: {
            "deviceType": "请选择设备类型",
            "deviceId": "请输入设备编号",
            "deviceName": "请输入设备名称",
            "codeName": "请选择地方码",
            "codeId": "请输入卡口号",
            "codeArea": "获取不到卡口位置，请检查卡口号是否输入正确"
          }
        }
      },
      approvalRecord: { //请假、补卡、加班、报销审批记录
        status: {
          "0": "审批中",
          "1": "审批通过",
          "2": "审批拒绝",
          "3": "已撤销"
        },
        approvalStats: {
          "1": "同意",
          "2": "拒绝",
          "3": "撤销",
          "4": "转交"
        }
      },
      approvalSetting: {
        approvalType: {
          "1": "订单审批",
          "3": "投料单审批",
          "4": "采购单审批",
          "5": "申补单审批",
          "6": "出入库审批",
          "7": "订单多人编辑",
          "8": "报工二次审核",
          "9": "物料清单审核",
          "10": "退货单审核",
          "11": "收付款审核",
          "12": "库存盘点审核",
          "13": "bom清单审核",
          "15": "bom商务订单审核",
          "14": "预收付款审批",
          "16": "bom订单多人编辑",
          "17": "商务订单多人编辑"
        }
      },
      returnOrder: {
        status: {
          "0": "未审核",
          "1": "已审核",
          "2": "已退回"
        },
        createOrder: {
          error: {
            count: "请输入退回数量",
            valuationCount: "请输入退回结算数量",
            unitPrice: "请输入退回单价",
            totalMoney: "请输入退回金额",
            countIsZero: "退回数量不能为0",
            unitPriceIsZero: "退回单价不能为0",
            "count>inCount": "退回数量不能大于入库数",
            "count>materialCount": "退回数量不能大于库存数"
          }
        },
        createOrderWarehouse: {
          error: {
            inCount: "请输入入库数量",
            valuationCount: "请输入入库结算数量",
            unitPrice: "请输入入库单价",
            totalMoney: "请输入入库金额",
            inCountIsZero: "入库数量不能为0",
            unitPriceIsZero: "入库单价不能为0",
            "inCount>canInCount": "入库数量不能大于可入库数"
          }
        },
        error: {
          count: "请输入出入库数量",
          selfOutFuCount: "请输入交接数"
        }
      },
      productMgr: {
        historyOrderType: {
          "3": "采购单",
          "4": "预采购单",
          "5": "出库单",
          "6": "外协单",
          "7": "发料单",
          "9": "入库单",
          "10": "退货单"
        },
        workProcessTable: {
          error: {
            content: "请输入qc内容",
            defalutValue: "请输入默认值",
            selfCheckTime: "请输入自检时间",
            siteCheckTime: "请输入巡检时间",
            selfCheckTimeIsZero: "自检时间不能为0",
            siteCheckTimeIsZero: "巡检时间不能为0",
            detailListIsNull: "工序的qc不能空",
            detailListRepeat: "qc内容有重复"
          }
        },
        qcReport: {
          type: {
            "1": "首件确认",
            "2": "自检",
            "3": "巡检"
          },
          status: {
            "0": "未审核",
            "1": "已审核",
            "2": "已退回"
          },
          result: {
            "1": "OK",
            "2": "NO"
          }
        },
        exceptionTable: {
          status: {
            "0": "未解决",
            "1": "已解决"
          },
          notifyStatus: {
            "0": "转交未处理",
            "1": "同意转交",
            "2": "拒绝转交"
          },
          orderStatus: {
            "0": "未解决",
            "1": "未转交",
            "2": "转交未处理",
            "3": "同意转交",
            "4": "拒绝转交",
            "5": "已解决"
          }
        }
      },
      orderProcedure: {
        sortMode: {
          "defaultSort": "默认排序",
          "firstSort": "排序一",
          "secondSort": "排序二",
          "thirdSort": "排序三"
        }
      },
      spotMaterial: {
        defaultWarehouse: {
          "1": "原材料仓",
          "2": "辅料仓"
        },
        error: {
          materialName: "请输入物料名称",
          model: "请输入规格型号",
          providerName: "请选择供应商名称",
          unit: "请选择单位",
          stock: "库存上限不能小于库存下限"
        }
      },
      orderMaterialTransfer: {
        error: {
          materialName: "请输入物料名称",
          model: "请输入规格型号",
          providerName: "请选择供应商",
          defaultWarehouse: "请选择默认仓库",
          materialType: "请选择物料类型",
          unit: "请选择单位",
          count: "请输入转仓数量"
        }
      },
      materialSupplyOrder: {
        orderType: {
          "1": "损耗申补",
          "2": "损坏申补"
        },
        status: {
          "0": "待审核",
          "1": "已审核",
          "2": "已退回"
        },
        error: {
          type: "请选择申补类型",
          applyCount: "请输入申补数量",
          applyCountZero: "申补数量不能为0",
          applyCountSame: "申补数量和之前相同，没有修改",
          applyReason: "请输入申补原因",
          createUser: "请选择申补人",
          personLiableList: "请设置责任人",
          companyShare: "请输入公司占比",
          companyShareZero: "公司占比不能为0"
        }
      },
      warehouseBalance: {
        detail: {
          status: {
            "0": "待审核",
            "1": "已审核",
            "2": "已退回"
          },
          type: {
            "1": "收款",
            "2": "付款"
          },
          addReduceType: {
            "0": "不增减",
            "1": "增加",
            "2": "减少"
          },
          isVerification: {
            "0": "未核销",
            "1": "已核销"
          }
        },
        error: {
          "type": "请选择收付款类型",
          "payPrice": "请输入付款金额",
          "payPriceZero": "付款金额不能为0",
          "receiptPaymentMode": "请选择付款方式",
          "relationBank": "请选择银行卡号",
          "customerName": "请选择收款方",
          "addReducePrice": "请输入增减金额",
          "addReducePriceZero": "增减金额不能为0",
          "addReduceReason": "请输入增减原因",
          "conversionPrice>sumPayPrice": "折算金额不能大于总付款金额",
          "invoicePrice": "请输入开票金额",
          "invoiceDate": "请选择开票日期"
        }
      },
      outBalance: {
        error: {
          "type": "请选择收付款类型",
          "payPrice": "请输入收款金额",
          "payPriceZero": "收款金额不能为0",
          "receiptPaymentMode": "请选择收款方式",
          "relationBank": "请选择银行卡号",
          "customerName": "请选择付款方",
          "addReducePrice": "请输入增减金额",
          "addReducePriceZero": "增减金额不能为0",
          "addReduceReason": "请输入增减原因",
          "conversionPrice>sumPayPrice": "折算金额不能大于总收款金额",
          "invoicePrice": "请输入开票金额",
          "invoiceDate": "请选择开票日期"
        }
      },
      remoteEquipment: {
        status: {
          "0": "禁用",
          "1": "使用"
        },
        error: {
          internetThingsCard: "请输入物联网卡ID",
          compny: "请选择使用公司",
          terminalUser: "请输入终端用户"
        }
      },
      outBusinessMgr: {
        warehouse: {
          queryType: {
            "1": "有库存",
            "2": "没有库存"
          }
        },
        orderTable: {
          inOutType: {
            "1": "外协返回",
            "2": "外协退回"
          },
          status: {
            "0": "未审核",
            "1": "已审核",
            "2": "退回"
          },
          isFinish: {
            "1": "完成",
            "2": "未完成"
          }
        }
      },
      purchaseInWarehouse: {
        type: {
          "1": "订单采购",
          "2": "库存采购",
          "3": "预采购"
        },
        error: {
          inCountUnit: "请选择入库单位",
          inCountPrice: "请输入入库单价",
          count: "请输入采购入库数量",
          countIsZero: "采购入库数量不能为0",
          sumMoneyCount: "请输入入库结算数量",
          sumMoneyCountIsZero: "入库结算数量不能为0",
          inOutMoney: "请输入金额",
          "count>purchaseCountMax": "采购入库数量与报废数量之和不能超过允许采购的最大范围"
        }
      },
      machineRepair: {
        repairMgr: {
          status: {
            "0": "不启用",
            "1": "启用"
          },
          error: {
            machineModel: "请输入设备型号",
            machineSerialNo: "请输入设备编号",
            outTime: "请选择出厂日期",
            buyer: "请输入客户",
            serviceManager: "请选择维修主管",
            serviceWorker: "请选择维修技工"
          }
        },
        repairTable: {
          custPay: {
            "1": "收费",
            "0": "不收费"
          },
          balancePrice: {
            "1": "已结算",
            "0": "待结算"
          },
          status: {
            "-2": "已退回",
            "0": "指派中",
            "1": "处理中",
            "2": "待评价",
            "3": "处理完毕"
          }
        },
        repairSetting: {
          status: {
            "0": "禁用",
            "1": "使用"
          },
          star: {
            "1": "1星",
            "2": "2星",
            "3": "3星",
            "4": "4星",
            "5": "5星"
          },
          error: {
            salaryType: "请输入维修评级",
            salary: "请输入维修薪资",
            starType: "请选择星级评级",
            starPercent: "请输入星级占比",
            visitType: "请输入回访评级",
            visitPercent: "请输入回访占比"
          }
        },
        warnSetting: {
          isShow: {
            "1": "显示",
            "2": "不显示"
          },
          field: {
            typeName: "警报类型为空",
            alarmCode: "警报代码为空",
            codeDescribe: "警报描述为空",
            codeNotValid: "警报代码不是正整数"
          },
          error: {
            typeName: "请输入警报类型",
            alarmCode: "请输入警报代码",
            codeDescribe: "请输入警报描述",
            codeNotValid: "警报代码数值必须为正整数"
          }
        },
        repairRecord: {
          status: {
            "0": "禁用",
            "1": "启用"
          },
          error: {
            machineModel: "请输入设备型号",
            workBrokenPart: "请选择故障部件",
            workBrokenDescription: "请输入故障描述",
            workBrokenSolveWay: "请输入解决方案"
          }
        }
      },
      remoteBoard: {
        repairTime: {
          field: {
            "avgTime": "平均时间",
            "minTime": "最快时间",
            "maxTime": "最慢时间"
          }
        },
        alarmCount: {
          field: {
            "monthCount": "月警报次数",
            "yearCount": "年警报次数",
            "count": "警报次数",
            "rate": "占比"
          }
        }
      },
      productOrderMgr: {
        deviceOrder: {
          error: {
            feedTotal: "请输入投料数",
            deptId: "请选择部门"
          }
        }
      },
      bomBusiness: {
        status: {
          "0": "禁用",
          "1": "启用"
        },
        defaultWarehouse: {
          "1": "原材料",
          "2": "辅料",
          "3": "信息备注"
        },
        materialLossSetting: {
          error: {
            "orderTotalStart": "请输入订单数最小值",
            "orderTotalEnd": "请输入订单数最大值",
            "wasteRate": "请输入损耗率",
            "wasteTotal": "请输入损耗数量",
            "status": "请选择状态",
            "waste": "损耗率与损耗数量必须填写一项"
          }
        },
        facilityLevelSetting: {
          error: {
            "rank": "请输入等级",
            "difficultLevelRate": "请输入难易度",
            "status": "请选择状态"
          }
        },
        bomMaterialSetting: {
          tableName: {
            materialColor: "颜色物料BOM",
            material: "物料BOM",
            subsidiary: "辅料BOM"
          },
          status: {
            "-1": "待审核",
            "1": "审核通过",
            "2": "退回"
          },
          applyStatus: {
            "-1": "待审核",
            "1": "审核通过",
            "0": "退回"
          },
          error: {
            "factoryNo": "请输入工厂型号",
            "ringSize": "请输入圈开料尺寸",
            "legSize": "请输入肶开料尺寸",
            "difficultLevelRate": "请输入难易度",
            "lineNo": "请输入序号",
            "materialType": "请选择物料类型",
            "materialObj": "请选择物料",
            "materialKlfs": "请输入开料方式",
            "materialDifficultLevelRate": "请输入难易度",
            "materialMtlktTotal": "请输入每条料可开数",
            "materialFeedTotalRate": "请输入投料数比例",
            "orderTotalStart": "请输入订单数最小值",
            "orderTotalEnd": "请输入订单数最大值",
            "wasteRate": "请输入损耗率",
            "wasteTotal": "请输入损耗数量",
            "hasOverlap": "输入的订单数区间有重叠",

            khhc: "请输入开料长度",
            khhk: "请输入开料宽度",
            ztkd: "请输入桩头宽度",
            ztcd: "请输入桩头长度",
            cutGap: "请输入切割缝隙",
            "totalcd>khhc": "开料长度不能小于2倍的桩头长度",
            "totalkd>khhk": "开料宽度不能小于2倍的桩头宽度"
          }
        },
        businessOrder: {
          status: {
            "-1": "待审核",
            "1": "审核通过",
            "2": "退回"
          },
          applyStatus: {
            "-1": "待审核",
            "1": "审核通过",
            "0": "退回"
          },
          error: {
            orderNo: "请输入订单编号",
            bomOrder: "请输入工厂型号",
            orderType: "请选择分类",
            deliveryTime: "请选择交货日期",
            lineNo: "请选择物料",
            noMaterial: "bom清单未设置物料",
            unitPrice: "请输入单价",
            orderTotal: "请输入订单数",
            deliveryDate: "请选择交期日期",
            deliveryCount: "请输入交期数量",
            lineNoRepeat: "所选择的物料有重复",
            "totalCount!==orderTotal": "交期总数量与订单数不相等",
            "noLineCount>1": "没有物料的记录只能有一行"
          }
        },
        materialClassify: {
          classifyLevel: {
            levelRankOne: "一级分类",
            levelRankTwo: "二级分类",
            levelRankThree: "三级分类",
            levelRankFour: "四级分类",
            levelRankFive: "五级分类",
            levelRankSix: "六级分类",
            levelRankSeven: "七级分类",
            levelRankEight: "八级分类",
            levelRankNine: "九级分类",
            levelRankTen: "十级分类"
          },
          status: {
            "0": "禁用",
            "1": "启用"
          },
          error: {
            levelRankOne: "请输入一级分类",
            levelRankTwo: "请输入二级分类",
            levelRankThree: "请输三级入分类",
            levelRankFour: "请输入四级分类",
            levelRankFive: "请输入五级分类",
            levelRankSix: "请输入六级分类",
            levelRankSeven: "请输入七级分类",
            levelRankEight: "请输入八级分类",
            levelRankNine: "请输入九级分类",
            levelRankTen: "请输入十级分类",
            repeat: "输入的分类名称有重复"
          }
        }
      },
      workReport: {
        reportMode: {
          "1": "人工",
          "2": "设备"
        }
      },
      produceOrder: {
        status: {
          "0": "禁用",
          "1": "启用"
        },
        type: {
          "1": "订单模版",
          "2": "流程卡模版",
          "3": "业务单模版"
        },
        pageSize: {
          "A3": "A3(297*420)",
          "A4": "A4(210*297)"
        },
        direction: {
          vertical: "纵向",
          horizontal: "横向"
        },
        field: {
          materialType: "物料类型",
          materialName: "物料名称",
          materialModel: "规格",
          materialColor: "色号",
          materialProviderName: "供应商",
          materialColorDescription: "颜色描述",
          orderTotal: "订单数",
          feedTotal: "投料数",
          yltsTotal: "用料数",
          date: "日期",
          count: "数量",
          remark: "说明",
          "classify-remark": "备注"
        },
        error: {
          pageText: "请选择纸张尺寸",
          pageDirection: "请选择纸张布局",
          pageSize: "请先去配置纸张的信息",
          pageTitle: "请输入生产订单抬头",
          projectImg: "工程图超出设置的可拖拽区域",
          otherTable: "有自定义表格超出设置的可拖拽区域",
          proDept: "请选择生产部门"
        }
      },
      calMaterialCut: {
        kllx: {
          "1": "横开",
          "2": "竖开",
          "3": "横竖混合开"
        },
        error: {
          khhc58: "请输入开料长度",
          khhk59: "请输入开料宽度",
          ztkd60: "请输入桩头宽度",
          ztcd61: "请输入桩头长度",
          ylc52: "请输入原料长度(X方向)",
          ylk53: "请输入原料宽度(Y方向)",
          sbl54: "请输入边料宽度(上)",
          xbl55: "请输入边料宽度(下)",
          kllx700: "请选择开料方式",
          "totalcd>khhc58": "开料长度不能小于2倍的桩头长度",
          "totalkd>khhk59": "开料宽度不能小于2倍的桩头宽度"
        }
      },
      iqc: {
        materialCheckType: {
          error: {
            materialName: "请选择物料名称",
            CheckTypeNull: "未设置物料的检验类型",
            checkTypeRepeat: "设置的检验类型有重复",
            checkTypeId: "检验类型未选择"
          }
        },
        iqcReport: {
          error: {
            isNeedApproval: "请选择是否需要审核",
            conclusion: "请勾选检验结论",
            checkMethod: "未勾选检测类型",
            samplingStandard: "未勾抽验取样标准",
            checkResult: "未勾检验结果"
          }
        },
        iqcReportApproval: {
          status: {
            "0": "待审核",
            "1": "已审核",
            "2": "已退回"
          }
        }
      }
    }
  };

  var config = allConfig[lang];
  var i18n = {
    config: config,
    getMsg: function (code) {
      if (typeof code !== 'string') {
        throw new Error('i18n getMsg field code is not string');
      }
      var value = _.get(this.config, code);
      if (value === undefined) {
        value = '';
      }

      return value;
    },

    getDropDown: function (dropPath, attrs, option) {
      var dropDown = [];
      var valueField = 'value',
        labelField = 'label';
      if (option !== undefined) {
        valueField = option.valueField || valueField;
        labelField = option.labelField || labelField;
      }

      if (attrs === undefined) {
        var listObj = this.getMsg(dropPath);
        for (var key in listObj) {
          var obj = {};
          obj[valueField] = key;
          obj[labelField] = listObj[key];
          dropDown.push(obj);
        }
      } else {
        for (var i = 0; i < attrs.length; i++) {
          var attr = attrs[i];
          var label = this.getMsg(`${dropPath}.${attr}`);
          var obj = {};
          obj[valueField] = attr;
          obj[labelField] = label;
          dropDown.push(obj);
        }
      }
      return dropDown;
    },

    getValues: function (path, attrs) {
      var obj = _.get(this.config, path);
      if (SysUtil.isEmpty(obj)) {
        return [];
      }
      var values = [];
      if (attrs === undefined) {
        values = Object.values(obj);
      } else {
        for (var i = 0; i < attrs.length; i++) {
          var attr = attrs[i];
          var value = obj[attr];
          values.push(value);
        }
      }
      return values;
    },

    getKeyByValue: function (path, value) {
      var obj = _.get(this.config, path);
      if (SysUtil.isEmpty(obj)) {
        return null;
      }

      for (var key in obj) {
        if (obj[key] === value) {
          return key;
        }
      }
      return null;
    }
  };
  return i18n;
}

var i18n = initI18n('zh-cn');
